沒有比較沒傷害,這篇來教學如何部署Elasticsearch叢集
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
sudo apt-get install apt-transport-https -y
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
sudo apt-get update && sudo apt-get install elasticsearch=7.9.1
編輯/etc/security/limits.conf新增這段
elasticsearch - nofile 65535
編輯/usr/lib/systemd/system/elasticsearch.service新增這段
[Service]
LimitMEMLOCK=infinity
編輯/etc/default/elasticsearch 移除這段註解
MAX_LOCKED_MEMORY=unlimited
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch
sudo systemctl start elasticsearch.service
你可能會看到mlockall:false,這是因為bootstrap.memory_lock沒有設定
GET _nodes?filter_path=**.mlockall
GET _nodes/stats/process?filter_path=**.max_file_descriptors
光是安裝就需要這麼麻煩,還是Elastic cloud方便